/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jpa.session;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import jpa.entities.CursoEmpleado;

/**
 *
 * @author Hassan
 */
@Stateless
public class CursoEmpleadoFacade extends AbstractFacade<CursoEmpleado> {
    @PersistenceContext(unitName = "bgx_rhPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public CursoEmpleadoFacade() {
        super(CursoEmpleado.class);
    }
    
    
    public List<CursoEmpleado> getEmpleadosByCursoId(int cursoId)
    {
        return em.createNamedQuery("CursoEmpleado.findByCursoId").setParameter("cursoId", cursoId).getResultList();
    }
}
